package com.isias.system.mapper;

import com.isias.model.dto.CourseDto;
import com.isias.model.dto.CourseWithStar;
import com.isias.model.dto.PingLunDto;
import com.isias.model.vo.CourseVo;
import com.isias.model.vo.SelectCourseVo;
import com.isias.model.vo.Star;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;
@Mapper
public interface CourseDtoMapper{

    List<CourseDto> SelectAll(@Param("vo") SelectCourseVo courseVo);

    CourseDto SelectOne(String id);     //根据课程id查询,主要用来数据回显

    Integer UpdataOneById(@Param("vo") CourseVo courseVo);//更改单个

    Integer RemoveOneById(String id);//逻辑删除

    Integer Add(@Param("vo") CourseVo courseVo);    //插入

    Integer RemoveByIds(List<String> ids);//批量删除

    @Update("update course set url=#{url} where id=#{id}")
    Integer UpdateUrlById(String url,String id);    //通过id更换课程图片url

    List<CourseDto> SelectAllById(String id,@Param("vo") SelectCourseVo courseVo);

    List<CourseDto> SelectMyCourse(String id,@Param("vo") SelectCourseVo courseVo);

    Integer AddCourseToMe(String userid,String Courseid);   //添加到我的课程

    String Judgement(String userid,String Courseid);        //判断是否已经添加课程了

    Integer DeleteCourseToMe(String userid,String Courseid);//删除课程

    Integer StarAndDescription(String userId, String courseId, @Param("vo") Star star);

    int GetStar(String courseId);  //获取总星数

    int GetStarNum(String courseId);

    Star GetStarInfo(String userId,String courseId);

    List<CourseWithStar> SelectAllStar();

    List<PingLunDto> GetPingLun(String courseId);

    List<CourseWithStar> SelectMostStudy();


}
